﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Douban.Api.Infrastructure
{
    public class LinkAttribute : ElementAttribute
    {
        private string _attributeFilter;

        public LinkAttribute(string attrFilter) : base("link")
        {
            _attributeFilter = attrFilter;
        }

        public override string GetXPath(System.Xml.XmlNamespaceManager nsManager)
        {
            return base.GetXPath(nsManager) + string.Format("[@rel='{0}']/@href", _attributeFilter);
        }
    }
}
